$(function () {
    layui.use(['element', 'layer', 'form', 'flow', 'rate'], function () {
        layer = layui.layer, form = layui.form, flow = layui.flow, rate = layui.rate, element = layui.element;
        rate.render({
            value: $('#hidden_score').val(),
            readonly: true,
            elem: '#score',
            theme: '#FE0000',
            length: 3
        })
    });
})

/**
 * 添加到购物车
 * @param id
 */
function addCar(id) {
    location.href = '/car/saveSingle?productId=' + id
}

function buy(id) {
    location.href = api.OrderInfo + '?productId=' + id
}